package com.example.demo.Controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@ResponseBody
@Controller
public class calcController {

    @RequestMapping("/calc")
    public String calc(Integer sum1,Integer sum2)
    {
        if (sum1 == null || sum2 == null)
        {
            return "参数错误";
        }
        return "结果=" + (sum1 + sum2);
    }
}
